const net = require('net')

const server = net.createServer(socket => {
  socket.on('data', function (buffer) {
    const seqBuffer = buffer.slice(0, 2)
    const lessonid = buffer.readInt32BE(2)

    setTimeout(() => {
      const buffer = Buffer.concat([seqBuffer, Buffer.from(data[lessonid])])
      socket.write(buffer)
    }, 500)
  })
})

server.listen(4000)

const data = {
  136797: '01 | tit',
  136798: '02 | tit',
  136799: '03 | tit',
  136800: '04 | tit',
  136801: '05 | tit',
  136802: '06 | tit',
  136803: '07 | tit',
  136804: '08 | tit',
  136805: '09 | tit',
}
